Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added optional: true to reader's belongs_to [Fixes #120] #121

Merged
merged 2 commits into from
Oct 31, 2020

Conversation

k-rudy
Copy link
Contributor

@k-rudy k-rudy commented Oct 29, 2020

Fixes the issue in Rails 6+ that has by default belongs_to_required_by_default = true setting enabled.

As a a result if any reader defines default scope and reader instance does not match that scope mark_as_read! fails with Reader must exist then

Thanks.

@ledermann
Copy link
Owner

Great, thanks! Would you mind adding a test to verify your change?

@k-rudy k-rudy changed the title Added optional: true to read_marks [Fixes #120] Added optional: true to reader's belongs_to [Fixes #120] Oct 30, 2020
@k-rudy
Copy link
Contributor Author

k-rudy commented Oct 30, 2020

@ledermann done

@ledermann ledermann merged commit 0f1b242 into ledermann:master Oct 31, 2020
@ledermann
Copy link
Owner

ledermann commented Oct 31, 2020

Thanks a lot, @k-rudy!

HwakyoungLee pushed a commit to grepp/unread that referenced this pull request May 12, 2023
…dermann#121)

* Added optional: true to read_marks [Fixes ledermann#120]
* Added specs for the optional reader case [Fixes ledermann#120]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants